<%@ Page Language="C#" MasterPageFile="~/Administrator/AdminPage.master" AutoEventWireup="true"
    CodeFile="ValueTypeAdmin.aspx.cs" Inherits="Administrator_ValueManager" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="titlefield">
        Value Management
    </div>
    <div class="manafield">
        <p>
            <asp:Label ID="lblStatus" runat="server"></asp:Label></p>
        <div class="field">
            <asp:Panel ID="pnlAddValue" runat="server">
                <p>
                    <asp:Label ID="lblAdd" Text="Insurance Type" runat="server" CssClass="lbl"></asp:Label>
                    <asp:DropDownList ID="ddlInsurance" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlInsurance_SelectedIndexChanged">
                    </asp:DropDownList>
                </p>
                <p>
                    <asp:Label ID="lblAddType" CssClass="lbl" Text="Value Type" runat="server"></asp:Label>
                    <asp:TextBox ID="txtAddType" CssClass="txt" runat="server" 
                        ValidationGroup="add"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="txtAddType" ErrorMessage="Required Value Type" 
                        ValidationGroup="add"></asp:RequiredFieldValidator>
                </p>
                <p>
                    <asp:Label ID="lblAddPrice" CssClass="lbl" Text="Price" runat="server"></asp:Label>
                    <asp:TextBox ID="txtAddPrice" CssClass="txt" runat="server" 
                        ValidationGroup="add"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                        ControlToValidate="txtAddPrice" ErrorMessage="Float number only" 
                        ValidationExpression="[-+]?([0-9]*\.)?[0-9]+" ValidationGroup="add"></asp:RegularExpressionValidator>
                </p>
                <p>
                    <asp:Button ID="btnAddValue" CssClass="btn" Text="Add" runat="server" OnClick="btnAddValue_Click" />
                    <asp:Button ID="btnCancelAdd" CssClass="btn" Text="Cancel" runat="server" OnClick="btnCancelAdd_Click" />
                </p>
            </asp:Panel>
            <asp:Panel ID="pnlEditValue" runat="server">
                <p>
                    <asp:Label ID="lblEdit" Text="Insurance Type" runat="server" CssClass="lbl"></asp:Label>
                    <asp:Label ID="lblInsurance" runat="server"></asp:Label>
                </p>
                <p>
                    <asp:Label ID="lblEditType" CssClass="lbl" Text="Value Type" runat="server"></asp:Label>
                    <asp:TextBox ID="txtEditType" CssClass="txt" runat="server" 
                        ValidationGroup="edit"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ControlToValidate="txtEditType" ErrorMessage="Required Value Type" 
                        ValidationGroup="edit"></asp:RequiredFieldValidator>
                </p>
                <p>
                    <asp:Label ID="lblEditPrice" CssClass="lbl" Text="Price" runat="server"></asp:Label>
                    <asp:TextBox ID="txtEditPrice" CssClass="txt" runat="server" 
                        ValidationGroup="edit"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                        ControlToValidate="txtEditPrice" ErrorMessage="Float number only" 
                        ValidationExpression="[-+]?([0-9]*\.)?[0-9]+" ValidationGroup="edit"></asp:RegularExpressionValidator>
                </p>
                <p>
                    <asp:Button ID="btnEditValue" CssClass="btn" Text="Edit" runat="server" 
                        OnClick="btnEditValue_Click" />
                    <asp:Button ID="btnCancelEdit" CssClass="btn" Text="Cancel" runat="server" 
                        OnClick="btnCancelEdit_Click" />
                </p>
            </asp:Panel>
            <asp:Label ID="lblError" runat="server" CssClass="error"></asp:Label>
        </div>
        <div>
            <div class="titleDataView">
                Data view
                  <asp:GridView ID="grvValue" runat="server" 
                BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="5px" 
                CellPadding="4" CellSpacing="2" CssClass="dataView" DataKeyNames="ValueId" 
                ForeColor="Black" 
                onrowdeleting="grvValue_RowDeleting" onrowediting="grvValue_RowEditing">
                <RowStyle BackColor="White" />
                <Columns>
                    <asp:ButtonField ButtonType="Button" CommandName="Edit" Text="Edit" />
                    <asp:ButtonField ButtonType="Button" CommandName="Delete" Text="Delete" />
                </Columns>
                <FooterStyle BackColor="#CCCCCC" />
                <PagerStyle BackColor="#CCFFFF" ForeColor="#003300" HorizontalAlign="Center" 
                    BorderColor="#999999" BorderStyle="Solid" BorderWidth="5px" Font-Size="Large" />
                <EmptyDataTemplate>
                    &nbsp; There isn&#39;t any result
                </EmptyDataTemplate>
                <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            </asp:GridView>
        </div>
    </div>
</asp:Content>
